{include file="public/layout" /}
<div class="cl pd-5 bg-1 bk-gray mt-20">
	<span class="l"><a class="back" href="/Admin/withdraw/lists" title="返回列表"><img src="/public/h-ui.admin/images/back.png" width="30" height="30"></a></span>
</div>
{if isset($info) }
<div class="pd-20" style="margin-top: 1rem;">
	<form class="navbar-form form-inline" action="/Admin/withdraw/handle" method="post">
	<table class="table">
		<tbody>
			<tr>
				<th class="text-r">用户ID：</th>
				<td>{$info.user_id}</td>
			</tr>
			<tr>
				<th class="text-r">用户名：</th>
				<td>{$info.username}</td>
			</tr>
			<tr>
				<th class="text-r">用户平台余额：</th>
				<td>{$info.user_money}</td>
			</tr>
			<tr>
				<th class="text-r">申请提现金额：</th>
				<td>{$info.money}</td>
			</tr>
			<tr>
				<th class="text-r">扣除手续费：</th>
				<td>{$info.taxfee}</td>
			</tr>
			<tr>
				<th class="text-r">实际到账金额：</th>
				<td>{$info.user_money - $info.taxfee}</td>
			</tr>
			<tr>
				<th class="text-r">申请时间：</th>
				<td>{$info.create_time|date="Y-m-d H:i:s"}</td>
			</tr>
			<tr>
				<th class="text-r">状态：</th>
				<td>
					<span style="color: red;">
					{switch $info.status}
					    {case -1}审核失败{/case}
					    {case 0}申请中{/case}
					    {case 1}审核通过{/case}
					    {case 2}付款失败{/case}
					    {case 3}拒接提现{/case}
					{/switch}
				    </span>
				</td>
			</tr>
			<tr>
				<th class="text-r">备注：</th>
				<td><textarea class="input-txt" rows="4" cols="60" id="remark" name="remark">{$info.remark}</textarea></td>
			</tr>
		</tbody>
	</table>
	 <div style="margin-left: 21%;">
	 	 <input type="hidden" name="id" value="{$info.id}">
	 	 {if $info.status == 0}
         <input class="btn btn-primary radius" type="button" value="审核通过" name="status" onclick="handle(this,1);"  data-url="/Admin/withdraw/handle" data-id="{$info.id}">
         <input class="btn btn-primary radius" type="button" value="拒接提现" name="status" onclick="handle(this,3);"  data-url="/Admin/withdraw/handle" data-id="{$info.id}">
         {/if}
    </div>
	</form>
</div>
	{else /}
	<div style="text-align: center; color: #ccccccc; margin-top: 1rem; font-weight: bold;">暂无数据</div>
{/if}
{include file="public/footer" /}
</body>
<script type="text/javascript">
function handle(obj,status){
	    var remark = $("#remark").val();
		$.ajax({
			type: 'POST',
			url: $(obj).attr('data-url'),
			data:{id: $(obj).attr('data-id'),status:status,remark:remark},
			dataType: 'json',
			success: function(data){
				if(data.status == 1) {
					layer.msg('操作成功!',{icon:1,time:1000});
					window.location.reload();
				} else {
					layer.msg('操作失败!',{icon:1,time:1000});
					window.location.reload();
				}
			},
			error:function(data) {
				console.log(data.msg);
			},
		});
}
</script>
</html>